<?php 
	require 'db.php';
	$sql ="SELECT * FROM oc_sport_academy WHERE status='1'";
	$query=mysql_query($sql);
	if($query&&mysql_num_rows($query)){
			while($row=mysql_fetch_assoc($query)){
				$academy[]=$row;
		}
	}

	if(!empty($_GET['academy'])){
		$a=$_GET['academy'];
		$sql ="SELECT * FROM oc_sport_score WHERE academy='$a' AND status='1' ORDER BY score desc";
		$query=mysql_query($sql);
		if($query&&mysql_num_rows($query)){
				while($row=mysql_fetch_assoc($query)){
					$data[]=$row;
			}
		}
	}
	mysql_close($link);
?>
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="style_mb.css">
	<script type="text/javascript" src="jquery-2.1.4.min.js"></script>
	<link type="text/css" rel="stylesheet" href="bootstrap.min.css"/>
	<script type="text/javascript" src="jquery-2.1.4.min.js"></script>
	<title>玉林师范学院第十八届田径运动会</title>
	<meta name="viewport" content="width=device-width, initial-scale=1" /> 
	<script type="text/javascript">
		$(function(){
			$(".select").each(function(){
				var s=$(this);
				var z=parseInt(s.css("z-index"));
				var dt=$(this).children("dt");
				var dd=$(this).children("dd");
				var _show=function(){dd.slideDown(200);dt.addClass("cur");s.css("z-index",z+1);};   //展开效果
				var _hide=function(){dd.slideUp(200);dt.removeClass("cur");s.css("z-index",z);};    //关闭效果
				dt.click(function(){dd.is(":hidden")?_show():_hide();});
				dd.find("a").click(function(){dt.html($(this).html());_hide();});     //选择效果（如需要传值，可自定义参数，在此处返回对应的“value”值 ）
				$("body").click(function(i){ !$(i.target).parents(".select").first().is(s) ? _hide():"";});
			})
		})
	</script>
	<style>
		a{
			text-decoration:none;
		}
		*{margin:0;padding:0;list-style-type:none;}
		a,img{border:0;}
		a,a:hover{text-decoration:none; color:#666;}

		.demo{margin:40px auto 0 auto;}

		/* select */
		.select{position:relative;float:left;margin:0 10px;color:#696969;}
		.select dt{height:28px;display:inline-block;border:1px solid #d2ccc4;background:#fcfcfb url(images/ico.gif) no-repeat 207px center;line-height:28px;font-weight:bold;padding-left:10px;cursor:pointer;width:295px;padding-right:12px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;position:relative;z-index:99;margin-top:5px;margin-bottom:5px;}
		.select dt:hover,.select dt.cur{border:1px solid #409DFE;box-shadow:0 0 3px #409DFE;}
		.select dd{position:absolute;left:0;top:35px;border:1px solid #d2ccc4;background:#fff;display:none;}
		.select dd ul{padding:4px;width:310px;max-height:250px;overflow:auto;}
		.select dd ul li a{line-height:28px;display:block;padding:0 8px;}
		.select dd ul li a:hover{background:#f5f5f5;}

	</style>
</head>
<body>
	<a href="index.php">
		<button class="back">返回</button>
	</a>
	<div class="contain">
		<header>
			<a href="http://www.yiban.cn/school/index/id/5000117"><img class="GXUST_logo" src="image/YSYB.png" alt="" width="215px" height="65px"></a>
			<!--<img class="yiban_logo" src="image/logo.png" alt="" >-->
			<h1>玉林师范学院第十八届田径运动会</h1>
		</header>
		
		<div class="card card_top" style="height:auto;">
		<img src="image/fsxq.png" style="display:block;margin:0 auto;" alt="">
		<a href="item.php"><div id="turn1" class="turngroup">按项目查询</div></a>
			<from>
			<dl style="margin-top:5px;" class="select">
							<dt><?php if(!empty($_GET['academy'])){ echo $_GET['academy'];}else{ echo "请选择学院";}?></dt>
							<dd>
								<ul>
								<?php for($i=0;$i<count($academy);$i++){?>
									<li><a href="notice.php?academy=<?php echo $academy[$i]['academy'];?>"><?php echo $academy[$i]['academy'];?></a></li>
								<?php } ?>
								</ul>
							</dd>
						</dl>
			<div class="space"></div>
			<?php if(!empty($data)){ ?>
			<div id="record" style="width:100%;">
			<?php for($i=0;$i<count($data);$i++){?>
				<p class="detail">&nbsp;<b><?php echo $data[$i]['name'];?></b>&nbsp;&nbsp;<?php echo $data[$i]['item'];?>&nbsp;&nbsp;<?php echo $data[$i]['rank'];?>&nbsp;&nbsp<b style="color:#F15757;"><?php echo $data[$i]['score'];?></b>分</p>
			<?php } ?>
			</div>
			<?php }else{ ?>
			<div id="record">
			暂无排名数据
			</div>
			<?php } ?>


			</from>
			<div class="space"></div>
			<div id="hint" style="display:none;text-align: center;margin-top:20px;">暂无排名数据</div>
			<img src="image/loading.gif" style="display:none;margin:0 auto;" alt="" id="loading">
			<div id="record">
			
			</div>
		</div>
		<div class="footer">
			<p class="link">版权所有：狂奔团队</p>
		</div>
	</div>
</body>
</html>